<#macro costDetailBox issues issueType>
  <#list issues?keys as issueSubType>
    <#assign typeIssues = issues[issueSubType] />
    <#if typeIssues?size gt 0>
      <#assign messagePrefix = "report.explain.class." +
              issueType?lower_case + "." +
              issueSubType?lower_case />

      <#assign wikiPage = issueType?capitalize?replace("_", "") + issueSubType?capitalize?replace("_", "") + "Explanation" />
      <p class="subIssueType">${message(messagePrefix)}
        <sup style="font-weight: normal;">
          <a href="http://code.google.com/p/testability-explorer/wiki/${wikiPage}">
          ${message("report.explain.linkToWiki")}</a>
        </sup>
      </p>

      <table class="issuesExplanation">
        <#list typeIssues as issue>
          <#assign rowStyle><#if issue_index % 2 == 0>even<#else/>odd</#if></#assign>
          <tr class="${rowStyle}">
            <td>
              <#if issue.lineNumberApproximate>
                ${message("report.explain.aroundLine")}
                <#else/>
                ${message("report.explain.onLine")}
              </#if>
              ${sourceLink(issue.location.file, issue.location.lineNumber?c, issue.location.lineNumber)},

            </td>
            <td>
              ${message(messagePrefix + ".element", "<tt>", issue.element, "</tt>")}
              <#-- ${message(messagePrefix + ".method", "UIUtils#archiveThread", "high", "high")} -->
            </td>
            <td class="percent">contributing ${issue.contributionToClassCost?string.percent} of total class cost</td>
          </tr>
        </#list>
      </table>
      <p class="suggestion">${message(messagePrefix + ".suggest")}</p>
    </#if>
  </#list>
</#macro>
